Page({
  data: {
    production: {
      imgs: [],
      index: 0,
      selectedUrl: ''
    },
    productionImgs: [
      { url: 'http://uploads.xuexila.com/allimg/1611/907-161124142T3-50.jpg'},
      { url: 'http://img4.imgtn.bdimg.com/it/u=3240544485,3673959083&fm=26&gp=0.jpg' },
      { url: 'http://img4.imgtn.bdimg.com/it/u=2722946476,339801558&fm=26&gp=0.jpg' },
      { url: 'http://img4.imgtn.bdimg.com/it/u=2177407898,428305058&fm=26&gp=0.jpg' },
      { url: 'http://img2.imgtn.bdimg.com/it/u=1551946155,849053375&fm=26&gp=0.jpg'}


    ],
    productionImgIndex: 0,
    selectedProductionImg: 'http://uploads.xuexila.com/allimg/1611/907-161124142T3-50.jpg'
  },
  onShareAppMessage(){

  },

  viewProductionImg(e){
    let ed = e.currentTarget.dataset;
    let productionImgs = [];

    ed.imgs.forEach((item, index) => {
      productionImgs.push(item.url);
    });


    wx.previewImage({
      current: ed.item,
      urls: productionImgs
    });
  },

  topProductionImg(e){
    let ed = e.currentTarget.dataset;
    this.setData({
      productionImgIndex: ed.index,
      selectedProductionImg: ed.item.url
    });

  }
});